<template>
	<view class="xb-page">
		<form @submit="submit">
			<view class="xb-form-cell">
				<view class="xb-form-cell-row">
					<input v-model="formdata.name" class="uni-input page-input xb-input" placeholder="请输入教室名称" />
				</view>
			</view>
			<view class="uni-flex uni-row xb-button-cell" style="justify-content: center;">
				<button class="xb-button" hover-class="none" type="primary" size="mini" form-type="submit">提交</button>
			</view>
		</form>
	</view>
</template>

<script>
	import pageHead from '../../../components/page-head.vue'
	import {
		mapActions,
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		computed: {
			...mapGetters(['roomList'])
		},
		data() {
			return {
				formdata: {
					name: '',
				}
			}
		},
		methods: {
			submit: async function(e) {
			uni.showNavigationBarLoading();
				const res = await addRoom(formdata);
				if (res.success == true) {
				uni.hideNavigationBarLoading();
				} else {
					console.log(JSON.stringify(e.detail.value));
				}

			}
		}


	}
</script>

<style scoped >
	@import "../../../common/uni.css";
	@import "../../../common/xb.css";

	.page-input {
		padding-left: 20px;
		height: 60px;
		background-color: #FFFFFF;

	}

	.page-button {
		background-color: #007AFF;
		width: 300px;
		height: 80px;
		border-radius: 0px;
	}
</style>
